const store = {
  set: function (key, value, callback) {
    if (!key || !value) return false
    window.localStorage.setItem(key, JSON.stringify(value))
    callback && callback()
  },
  get: function (key) {
    if (!key) return false
    return JSON.parse(window.localStorage.getItem(key))
  },
  remove: function (key, callback) {
    if (!key) return false
    window.localStorage.removeItem(key)
    callback && callback()
  },
  clear: function (callback) {
    window.localStorage.clear()
    callback && callback()
  }
}

export default store
